home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 62 / Quick PC 62.iso / I386 / IIS5_01.CAB / IIS_Redirect_VBScript.asp < prev    next >
Encoding:
Text File  |  1998-05-29  |  1.2 KB  |  53 lines

  1. <%@ Language = VBScript %>
  2. <% Option Explicit %>
  3.  
  4. <!*************************
  5. This sample is provided for educational purposes only. It is not intended to be 
  6. used in a production environment, has not been tested in a production environment, 
  7. and Microsoft will not provide technical support for it. 
  8. *************************>
  9.  
  10.  
  11. <%
  12.     'Because we might be redirecting, we must use buffering.
  13.     Response.Buffer = True
  14. %>
  15.  
  16.  
  17. <HTML>
  18.     <HEAD>
  19.         <TITLE>Redirect Sample</TITLE>
  20.     </HEAD>
  21.  
  22.     <BODY BGCOLOR="White" TOPMARGIN="10" LEFTMARGIN="10">
  23.         
  24.         <!-- Display header. -->
  25.  
  26.         <FONT SIZE="4" FACE="ARIAL, HELVETICA">
  27.         <B>Redirect Sample</B></FONT><BR>   
  28.  
  29.         <%
  30.             'If the referring page did not come from
  31.             'the sight "trainer3", redirect the user
  32.             'to www.microsoft.com.
  33.  
  34.             If Instr(Request.ServerVariables("HTTP_REFERER"), "trainer3") > 0 Then
  35.  
  36.                 'They came from within the trainer3 web
  37.                 'site so we let them continue.
  38.                 
  39.             Else
  40.             
  41.                 'They just linked from outside of the site.
  42.                 Response.Redirect("http://www.microsoft.com")
  43.                 
  44.             End If
  45.  
  46.  
  47.             'Flush Response Buffer.
  48.             Response.Flush
  49.         %>
  50.  
  51.     </BODY>
  52. </HTML>
  53.